<?php

Yii::import('zii.widgets.CPortlet');

class RecentPosts extends CPortlet
{
    // {{{ *** Members ***
    public $title='Recent Posts';
    public $maxPosts=10;
    // }}} 
    // {{{ init
    public function init()
    {
        $this->title=CHtml::encode(Yii::t('site','Recent News'));
        parent::init();
    } // }}} 
    public function getRecentPosts()
    {
            return Post::model()->findRecentPosts($this->maxPosts);
    }

    protected function renderContent()
    {
            $this->render('recentPosts');
    }
}
